<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // var date=new Date("2020-10-1");//1970:格林威治时间
        // var times=date.getTime();
        // var dd=new Date(times);
        // console.log(dd);
        // var date=new Date();
        // var result=date.getFullYear();
        // console.log(result);
        // var date=new Date();
        // var result=date.setFullYear(2021);
        // console.log(date);
        var today=new Date();
        var endDay=new Date("2020/10/1");
        var result=(endDay-today)/1000;
        // console.log(result);
        var day=parseInt(result/(24*60*60));
        // console.log(day);
        var hour=parseInt((result-day*24*60*60)/(60*60));
        // console.log(hour);
        var min=parseInt((result-day*24*60*60-hour*60*60)/60);
        // console.log(min);
        var sec=parseInt(result-day*24*60*60-hour*60*60-min*60);
        // console.log(sec);
        console.log("距离国庆放假还有："+day+"天"+hour+"小时"+min+"分"+sec+"秒");
    </script>
</head>
<body>
    
</body>
</html>